# noinspection PyBroadException


class CheckPoint(object):
    def __init__(self):
        self.flag = 0

    def equal(self, a, b):
        try:
            assert a == b
        except Exception:
            self.flag += 1
            print('等于类型断言失败，实际结果{a}预期结果{b}'.format(a=a, b=b))

    def more_than(self, a, b):
        try:
            assert a > b
        except Exception:
            self.flag += 1
            print('大于类型断言失败，实际结果{a}预期结果{b}'.format(a=a,b=b))

    def content_in(self, a, b):
        try:
            assert b in a
        except Exception:
            self.flag += 1
            print('内容存在类型断言失败，实际结果{a}预期结果{b}'.format(a=a, b=b))

    def in_range(self, a, b):
        for i in a:
            try:
                # assert i >= b[0] and i <= b[1]
                assert b[0] <= i <= b[1]
            except Exception:
                self.flag += 1
                print('在范围内类型断言失败，实际结果{a}预期结果{b}'.format(a=a, b=b))

    def number_eaqual(self, a, b):
        try:
            assert a[0] == b and a[1] == b
        except Exception:
            self.flag += 1
            print('个数等于类型断言失败，实际结果{a}预期结果{b}'.format(a=a,b=b))

    def result(self):
        assert self.flag == 0
